Skip to content

ref: move to Ferrum's new JavaScript API - #350

Merged
route merged 6 commits into
mainfrom
feat/ferrum-js-api
Oct 26, 2026
Merged

route merged 6 commits into
mainfrom
feat/ferrum-js-api

Conversation

@route

@route route commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves Cuprite off the old evaluate_on / evaluate_async helpers to Ferrum's new JavaScript API.

  • Node scripts go through node.evaluate(...) instead of evaluate_on(node:, expression:)
  • Page#set passes the value as an argument to node.evaluate rather than resolving the object id by hand
  • parents uses a function declaration, so it returns nodes on every Ferrum version
  • trigger(:click) waits for navigation with Ferrum's wait_for_navigation!
  • drag_by scrolls with Ferrum's mouse.scroll_by
  • Browser#evaluate_async wraps the script in a promise built on evaluate with a timeout

Fix

Node#[] now uses the property only when it's a string, number, or boolean, and reads the attribute otherwise. Before, a property holding a node (for example input.form) came back as a node instead of the attribute value.

Tests

  • Triggered click waits for the page it opens to load
  • Node#[] returns the attribute for a property that holds a node

@route
route merged commit a5e37de into main Oct 26, 2026
6 checks passed
@route
route deleted the feat/ferrum-js-api branch October 26, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant